The present invention relates to a program alteration system for a camera which incorporates a flash memory, and its control method.
Conventionally, a microcomputer mounted in a camera normally uses a mask ROM and, hence, the contents of the entire program area cannot be altered. Some cameras use a memory such as an EEPROM which is rewritable in units of bytes, and can rewrite data and parameters. However, a rewrite control program (loader) itself exists in the mask ROM. Therefore, even when data and parameters are rewritten in such camera, the loader itself is not rewritten; it is impossible to destroy the loader itself.
Recently, a microcomputer that incorporates a flash memory which can simultaneously erase the contents of its program area in units of bytes has become popular. For example, in case of a 32-bit microcomputer named V853 available from NEC corp., the entire 128-kbyte program ROM area is made up of a flash memory.
However, in V853, the loader itself is incorporated as firmware of the microcomputer. Therefore, the contents of the flash memory in the microcomputer are rewritten after the microcomputer is reset, and its mode is switched to a flash rewrite mode as one of test modes.
However, in the conventional microcomputer which incorporates the flash memory, the contents of the flash memory can be rewritten in only the mode under the control of firmware, as described above. In such mode under the control of firmware, a user program cannot run. Hence, customization such as arbitrary initialization of the I/O ports of the microcomputer by the user program cannot be attained, and it is impossible to rewrite the loader itself for the purpose of improving the function of the loader itself, which controls flash memory rewrites.